package com.ulife.order.api.response;

import com.ulife.common.gateway.utils.annotation.Description;

import java.io.Serializable;
import java.text.DecimalFormat;

/**
 * Created by Ulife- on 2015/12/30.
 */
@Description("亿起发订单商品信息")
public class YqfOrderItemInfo implements Serializable {
    @Description("商品CODE")
    public String productNo;
    @Description("商品名称")
    public String name;
    @Description("商品数量")
    public int amount;
    @Description("商品单价==>商品单价*[1-( 优惠券金额/总价 )]")
    public double price;
    @Description("商品类别")
    public String category;
    @Description("佣金类型")
    public String commissionType;

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public double getPrice() {
        return formatFloat(price);
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCommissionType() {
        return commissionType;
    }

    public void setCommissionType(String commissionType) {
        this.commissionType = commissionType;
    }

    private double formatFloat(double x){
        return   new Double(new DecimalFormat("###0.00").format(x));
    }
}
